<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>显示列表项的内容</title>
    <script type="text/javascript">
        function displayItem() {
            var a = document.getElementById("se")
            alert("教材名称："+a.options[a.selectedIndex].innerText+"\n"+"定价："+a.options[a.selectedIndex].value)
        }
    </script>
</head>
<body>
<h3>显示列表项的内容</h3><br>
<form>
    <select id="se" name="object" size="5" onclick="displayItem()">
        <option value="35元" selected>计算机组成原理</option>
        <option value="38元">数据结构</option>
        <option value="43元">计算机网络</option>
        <option value="40元">Java程序设计</option>
        <option value="28元">算法分析</option>
    </select>
</form>
</body>
</html>